package com.fengye.api.controller;

import com.fengye.common.annotation.Log;
import com.fengye.common.domain.MyPage;
import com.fengye.common.domain.ResponseResult;
import com.fengye.common.domain.entity.Pictures;
import com.fengye.api.service.PicturesService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * PictureController
 *
 * @author 枫叶fy
 * @description 图片模块控制器类
 * @since 2024/5/18 22:38
 */
@Api(tags = "图片模板模块")
@RestController
@RequestMapping("/picture")
@CrossOrigin
public class PictureController {

    @Autowired
    private PicturesService picturesService;

    /**
     * 按图片分页查询图片模板列表
     * @return 图片模板列表
     */
    @Log(businessName = "图片模板列表接口")
    @GetMapping(path = "/list")
    public ResponseResult<MyPage<Pictures>> getPicTmplList(Long categoryId, Integer pageNum, Integer pageSize) {
        MyPage<Pictures> picTmplPage = picturesService.picTplList(categoryId, pageNum, pageSize);
        return ResponseResult.success(picTmplPage);
    }
}
